home *** CD-ROM | disk | FTP | other *** search
/ Aminet 7 / Aminet 7 - August 1995.iso / Aminet / text / hyper / ADtoHT2_1.lha / Source.lha / MyLib.lha / stdio / ungetc.c < prev    next >
Encoding:
C/C++ Source or Header  |  1995-03-04  |  348 b   |  28 lines

  1. #include <stdio.h>
  2.  
  3. #include <proto/dos.h>
  4.  
  5. /************************************************************************/
  6.  
  7. #undef ungetc
  8.  
  9. int ungetc(int c, FILE *Stream)
  10.  
  11. {
  12.   int Result;
  13.  
  14.   if (c!=EOF)
  15.     {
  16.       Result=UnGetC(fileno(Stream),c);
  17.       if (Result!=c)
  18.     {
  19.       Result=EOF;
  20.     }
  21.     }
  22.   else
  23.     {
  24.       Result=EOF;
  25.     }
  26.   return Result;
  27. }
  28.